extends layout

block content
  include includes/header.pug
  main(role='main')
    if username
      section.jumbotron
        .container
          h1.jumbotron-heading.text-center(style="margin-bottom: 20px") Upload
          form.lead(action="/images/", method="post", enctype="multipart/form-data")
            .form-group.row
              label.col-12.col-md-3.text-muted View
              input.col-12.col-md-9.form-control(type="file", name="imgfile")
            .form-group.row
              label.col-12.col-md-3.text-muted Title 
              input.col-12.col-md-9.form-control(type='text', name='title')
            .form-group.row
              label.col-12.col-md-3.text-muted Description 
              input.col-12.col-md-9.form-control(type='text', name='description')
            .form-group.row
              .col-12.offset-md-8.col-md-4
                button.btn.btn-primary.btn-block(type='submit') Submit
    .album.py-5.bg-light
      .container
        .row
          .card-columns
            each image in images
              a.card.box-shadow.text-muted(href=`/images/${image.id}`)
                img.card-img-top(src=`/uploads/${image.diskfilename}`, alt=image.title)
                .card-body
                  h5.card-title= image.title
                  p.card-text= image.description
                  .d-flex.justify-content-between.align-items-center
                    //- .btn-group
                    //-   button.btn.btn-sm.btn-outline-secondary(type='button') View 
                    //-   button.btn.btn-sm.btn-outline-secondary(type='button') Edit
                    //- small.text-muted 9 mins
  include includes/footer.pug
  script(src='https://code.jquery.com/jquery-3.2.1.slim.min.js', integrity='sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN', crossorigin='anonymous')
  script.
    window.jQuery || document.write('<script src="../public/javascripts/jquery-slim.min.js"><\\\\/script>')
  script(src='/javascripts/popper.min.js')
  script(src='/javascripts/bootstrap.min.js')
  script(src='/javascripts/holder.min.js')